<template>
    <view class="u-demo-block">
        <img style="width: 100%" src="https://demo-sjh.oss-cn-beijing.aliyuncs.com/images/2022/07/19/16582295163813122.jpg" />
        <button @click="payDone">确认支付</button>
    </view>
</template>

<script>
    import Request from '../../utils/request'
    export default {
        data() {
            return{
                value1:2
            }
        },
        created(){

        },
        methods:{
            payDone(){
                let s=uni.getStorageSync("orders")
                Request.request('management-mall/leyou.order/order-goods/paymentDone'
                    , {ordersKey: s}, 'post').then(res => {
                    console.log(res)
                    if(res.success){
                        uni.removeStorageSync("orders")
                        uni.showToast({
                            icon:'success',
                            title:'购买成功',
                            success:function (){
                                uni.navigateTo({
                                    url: '/'
                                });
                            }
                        })

                    }
                }).catch(error => {
                    console.error(error)
                })
            }
        }
    }
</script>

<style>

</style>
